package da25_start.练习;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class 概率点名 {
    public static void main(String[] args) {
        //"范闲","范建","范统","杜子腾","宋合泛”,"侯笼藤","朱益群”,"朱穆朗玛峰"
        // "杜琦燕","袁明媛","李猜”,"田蜜蜜"
        //班级里有N个学生
        //要求:
        //70%的概率随机到男生
        //30%的概难随机到女生
        Random r = new Random();
        ArrayList<String> boy = new ArrayList<>();
        ArrayList<String> gift = new ArrayList<>();
        Collections.addAll(boy, "范闲","范建","范统","杜子腾","宋合泛","侯笼藤","朱益群","朱穆朗玛峰");
        Collections.addAll(gift,"杜琦燕","袁明媛","李猜","田蜜蜜");
        ArrayList<Integer> gl = new ArrayList<>();
        Collections.addAll(gl,0,0,0,1,1,1,1,1,1,1);
        Collections.shuffle(gl);
        int number = gl.get(r.nextInt(gl.size()));
        if (number == 1){
            Collections.shuffle(boy);
            System.out.println(boy.get(0));
        } else if (number == 0) {
            Collections.shuffle(gift);
            System.out.println(gift.get(0));
        }
    }
}
